Re: [SQL] Re: [GENERAL] Determining if "in a text set" - Mailing list pgsql-sql

From Herouth Maoz
Subject Re: [SQL] Re: [GENERAL] Determining if "in a text set"
Date
Msg-id l0311070db32419557de6@[147.233.148.142]
Whole thread Raw
In response to Re: [GENERAL] Determining if "in a text set"  (Herouth Maoz <herouth@oumail.openu.ac.il>)
Responses Re: [SQL] Re: [GENERAL] Determining if "in a text set"  (Richi Plana <richip@mozcom.com>)
List pgsql-sql
At 19:24 +0200 on 28/03/1999, I  wrote:


>
> If the spaces between the words in your phrase are not just plain spaces
> but can also be tabs etc, you will have to use the regexp version, and
> write something like '[ \t\r\f\n]' - though I'm less than sure that
> postgres's regular expressions support these. Can anyone tell us which
> regexp definition postgres uses?

OK, I looked into it more deeply. The regular expressions in postgres seem
to follow the rules in the 'regex(5)' manpage.

So, if the delimiters are not necessarily plain space characters, you could
match, using the '~' version, with '[[:space:]]' instead of ' '. Ugly, but
it matches also tabs and newlines.

At least it does on my solaris. I'm not sure whether this is or is not
OS-dependent.

As for the words in the field, which you said can have trailing spaces. If
these spaces also may be tabs or newlines, you should use rtrim with two
arguments, and the second argument is a string of all characters which need
removal from the end of the string. The point is, however, that you type in
an actual tab or an actual newline.

Hope you followed me so far.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma




pgsql-sql by date:

Previous
From: Herouth Maoz
Date:
Subject: Re: [GENERAL] Determining if "in a text set"
Next
From: Richi Plana
Date:
Subject: Re: [SQL] Re: [GENERAL] Determining if "in a text set"